<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Twin Tulipware</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?></head>
<body>
<div id="page1">
<div id="wrapper">
	<?php $this->load->view('admin_views/header'); ?><hr />
	</div>
	<div id="page">
	<div id="page-bgtop">
		<div id="content">
			<div class="post">
				<h2 class="title">Data Penjualan</h2>
				<div style='float:right;'><?php echo anchor('laporan/data_penjualan_nota_hadiah/','Data penjualan nota hadiah'); ?></div>
			 <form method="post" action="<?php echo base_url(); ?>laporan/data_penjualan">
                    <table>
                        <tr>
                            <td>
                                Cari Berdasarkan Tanggal &nbsp; <input type="text" name="nama" id="demo3" size="25" /><a href="javascript:NewCssCal('demo3','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Cari Berdasarkan Dealer &nbsp;&nbsp;&nbsp; <input name="dealer" type="text" />
                                <input type="submit" name="submit" value="Cari">
                            </td>
                        </tr>
                    </table>
                </form>
 <?php
	$banyak = count($datetgl->result_array());
	echo '<tr><td>Ditemukan <b>'.$banyak.'</b> hasil pencarian dengan Tanggal <b>"'.$nama.'"</b> dan Nama Dealer <b>"'.$dealer.'"</b></td></tr>'; ?>
		        <table width="90%" border="0" cellpadding="1" cellspacing="1" id="data" align="center">
        <thead>
        <tr  align="center" class="data" >
           <th rowspan="2" >No Nota</th>
           <th rowspan="2" >Nama Dealer</th>
            <th rowspan="2" >Upline</th>
            <th rowspan="2" >Unit</th>
            <th colspan="2" >Action</th>
        </tr>
        <tr  align="center" class="data" >
          <th >View</th>
          <?php if ($this->session->userdata('privilege')== 1){?><th >Hapus</th><?php } ?>
        </tr>
    </thead>
    <tbody>

    <!-- ============isi ============ -->

		<?php
      // if(!empty($data_penjualan)){
			$i=1;
			//foreach($data_penjualan as $m) : 
          if(count($datetgl->result_array())>0)
	      {
	        foreach($datetgl->result_array() as $m)
	        {
		  
		?>
      	<tr class='data' align='center'>
			<td  align="left">&nbsp;<?php echo $m['intno_nota']; ?></td>
			<td align='left'>&nbsp;<?php echo $m['strnama_dealer']; ?></td>
            <td align='left'>&nbsp;<?php echo $m['strnama_upline']; ?></td>
            <td align='left'>&nbsp;<?php echo $m['strnama_unit']; ?></td>
            <td align='center'>&nbsp;<?php if ($m['is_asi']==1) echo anchor('laporan/viewNotaAsi/'.$m['intno_nota'],'View',array('class' => 'update')); else echo anchor('laporan/viewNota/'.$m['intno_nota'],'View',array('class' => 'update')); ?></td>
            <?php if ($this->session->userdata('privilege')== 1){?><td align='center'> <?php echo anchor ('laporan/hapus/'.$m['intno_nota'], 'Hapus', array('onClick' =>"return confirm ('Apakah Anda yakin akan menghapus data ')")); ?></td><?php } ?>
      	</tr>
		<?php 
       // endforeach; 
       // }else{
	   }
	    }
	    else
	    {
	        echo '<tr><td>Tidak ditemukan dealer dengan nama <b>"'.$nama.'"</b></td></tr>';
	    }
        ?>

    <?php //} ?>
    </tbody>
</table>
		 <table width="90%" border="0" cellpadding="1" cellspacing="1" id="data" align="center">
  <tr>
    <td align="left" ><?php echo $pagination; ?></td>
    <td align="right" style="width:75%" ></td>
  </tr>
</table>
		<div id="pager1"></div>  <!--pagination div-->
		  </div>
			</div>
			
		</div>
		<!-- end #content -->
		<?php $this->load->view('admin_views/sidebar_laporan'); ?><!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	<!-- end #page -->
	<div id="footer-bgcontent">
	<?php $this->load->view('admin_views/footer'); ?></div>
	<!-- end #footer -->

</body>
</html>
